<!--
 * @Description: 审批意见
 * @Author: zhailei
 * @Date: 2021-05-31 18:44:52
 * @LastEditTime: 2021-05-31 18:58:03
 * 
 * @FilePath: \-cloud-topvui\src\pages\workflow\oaLeave\comment.vue
-->
<template>
  <t-modal
    :title="$ct('approvalComments', '审批意见')"
    :width="640"
    :visible="visible"
    :okText="okText"
    @ok="
      () => {
        visible = false;
      }
    "
    @cancel="
      () => {
        visible = false;
      }
    "
  >
    <a-table
      size="small"
      :rowKey="(record, index) => record.comment.id"
      :columns="$toI18nFormat(columns)"
      :data-source="dataList"
      :pagination="false"
    >
      <template
        v-for="(item, index) in $toI18nFormat(columns)"
        :slot="item.slotName"
      >
        <span :key="index">{{ $ct(item.slotName, item.defaultTitle) }}</span>
      </template>
    </a-table></t-modal
  >
</template>

<script>
const columns = [
  {
    title: "当前环节",
    dataIndex: "activityName",
    sorter: false,
    align: "center",
    langCode: "CurrentPhase",
  },
  {
    title: "执行人",
    dataIndex: "userName",
    sorter: false,
    align: "center",
    langCode: "Executor",
  },
  {
    title: "操作",
    dataIndex: "comment.typeName",
    sorter: false,
    align: "center",
    langCode: "typeName",
  },
  {
    title: "审批意见",
    dataIndex: "comment.message",
    sorter: false,
    align: "center",
    langCode: "approvalComments",
  },
  {
    title: "处理时间",
    dataIndex: "comment.time",
    sorter: false,
    align: "center",
    langCode: "ProcessingTime",
  },
];
export default {
  data() {
    return {
      okText: "关闭",
      columns,
      dataList: [],
      visible: false,
    };
  },
  methods: {
    getCommentList(uuid) {
      this.$post("/workflow/oaLeave/getListCommentsByBusinessKey", {
        businessKey: uuid,
      }).then((res) => {
        if (res.statusCode != 300) {
          this.visible = true;
          this.dataList = res.commentBeans;
        } else {
          this.$message.error(res.message);
        }
      });
    },
  },
};
</script>

<style lang="scss" scoped></style>
